{% extends "layout/admin.html" %}

{% block title %}商品{{shop.name}}规格和价格管理{% endblock %}

{% block content %}
<div class="mb10 fl"><a class="but" href="/admin/shops">返回商品管理</a> <a href="/admin/addshopattr/{{shop.id}}" class="but">添加规格和价格</a></div>
<hr>
<h1>商品{{shop.name}}规格和价格管理</h1>
{%set messages=handler.get_flashed_messages() %}
{%if messages%}
    <div class="msg">
        {% for type, msg in messages%}
            <span>{{msg}}</span>
        {% endfor %}
    </div>
{%endif%}

{% if shopattrs -%}
  <table class="table">
          <thead>
            <tr>
              <th>#</th>
              <th>规格</th>
              <th>价格</th>
              <th>排序</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
          {% for shopattr in shopattrs -%}

            <tr>
              <td>{{shopattr.id}}</td>
              <td>{{shopattr.name}}</td>
              <td>{{shopattr.price}}</td>
              <td>{{shopattr.order}}</td>
              <td><a href="/admin/editshopattr/{{shopattr.id}} ">修改</a> / <a href="/admin/delshopattr/{{shopattr.id}} ">删除</a></td>
            </tr>
		{%- endfor %}
          </tbody>
        </table>
        {{pagehtml}}
{%- else -%}

<p>暂无规格和价格</p>

{%- endif %}
{% endblock %}